package top.songxs.gmall.product.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.songxs.gmall.common.result.Result;
import top.songxs.gmall.common.result.ResultCodeEnum;
import top.songxs.gmall.product.entity.BaseCategory3;
import top.songxs.gmall.product.service.BaseCategory3Service;

import java.util.List;

@RestController
@RequestMapping("admin/product")
public class BaseCategory3Controller {
    @Autowired
    private BaseCategory3Service baseCategory3Service;

    @GetMapping("getCategory3/{category2Id}")
    public Result<List<BaseCategory3>> findAllBaseCategory3ByC2Id(@PathVariable(value = "category2Id") Long c2Id){
        List<BaseCategory3> lists = baseCategory3Service.findAllBaseCategory3ByC2Id(c2Id);
        return Result.build(lists, ResultCodeEnum.SUCCESS);
    }
}
